VERSION 5.00 Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "mswinsck.ocx" Begin VB.Form Form1 Caption = "Form1" ClientHeight = 4110 ClientLeft = 60 ClientTop = 345 ClientWidth = 5790 LinkTopic = "Form1" ScaleHeight = 4110 ScaleWidth = 5790 StartUpPosition = 3 'Windows Default Begin VB.TextBox txtIn Height = 330 Left = 75 TabIndex = 1 Top = 3795 Width = 5700 End Begin VB.TextBox txtOut Height = 3765 Left = 45 MultiLine = -1 'True ScrollBars = 2 'Vertical TabIndex = 0 Top = 15 Width = 5730 End Begin MSWinsockLib.Winsock Winsock1 Left = 525 Top = 600 _ExtentX = 741 _ExtentY = 741 _Version = 393216 End End Attribute VB_Name = "Form1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Option Explicit Private Sub Form_Load() Winsock1.Connect "127.0.0.1", 1118 End Sub Private Sub txtIn_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then Winsock1.SendData txtIn.Text txtIn.Text = "" KeyAscii = 0 End If End Sub Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long) Dim S As String Winsock1.GetData S, vbString Me.txtOut.Text = Me.txtOut.Text & Replace(S, Chr(10), vbCrLf) & vbCrLf End Sub